//
//  CollectionHengView.h
//  EasyWedding
//
//  Created by wangliang on 16/10/27.
//  Copyright © 2016年 com.jinyouapp. All rights reserved.
//

#import <UIKit/UIKit.h>

@class CollectionHShowView;
@protocol CollectionHShowViewProcotol <NSObject>
@optional
/**
 用户点击了cell
 */
- (void)hShowView:(CollectionHShowView *)hView didSelectedItemAtIndexPath:(NSIndexPath *)indexPath;

/**
 collectionView.pagingEnabled=YES 时起作用,返回当前页码
 */
- (void)hShowView:(CollectionHShowView *)hView didChangeCurrentShowIndex:(NSInteger)index;
@end

@interface CollectionHShowView : UIView

@property (nonatomic ,weak) id<CollectionHShowViewProcotol> delegate;

@property (strong, nonatomic)  UICollectionView *collectionView;

/**
 *  collectionView 数据源
 */
@property (strong, nonatomic)  NSArray *dataSource;

/**
 *  只能有一种 cell
 */
- (instancetype)initWithClassCell:(NSString *)classCellName modelName:(NSString *)modelName cellSize:(CGSize)size layout:(UICollectionViewFlowLayout * __nullable)layout;
- (instancetype)initWithNibCell:(NSString *)nibCellName modelName:(NSString *)modelName cellSize:(CGSize)size layout:(UICollectionViewFlowLayout * __nullable)layout;

//- (void)setData:(NSArray *)dataArray;
- (void)setDefaultSelectIndexPath:(NSIndexPath *)defaultSelectIndexPath;

@end
